<template>
  <div :class="type">
      <ul class="oul">
        <li v-for="(item, index) in arr"
            :class="{ active: count === index }"
            @click="count = index"
           :key="index">
          {{ item.title }}
        </li>
      </ul>
      <div class="con">
        {{ arr[count].con }}
      </div>
  </div>
</template>

<script>
export default {
  props: {
    arr: {
      type: Array,
      required: true
    },
    index: {
      type: Number,
      required: true
    },
    type: {
      type: String
    }
  },
  data() {
    return {
      count: this.index
    }
  }
}
</script>

<style scoped>
.oul {
  display: flex;
  text-align: center;
  line-height: 46px;
}
.oul li {
 flex: 1;
}
.con {
  height: 140px;
  text-align: center;
  line-height: 140px;
}

.vertical {
  display: flex;
}

.vertical > .oul {
  display: flex;
  flex-direction: column;
}

.vertical > .con {
  flex: 1;
  text-align: center;
}
</style>